package educrypt.gui.components;

import java.awt.*;
import java.awt.event.ActionListener;

import javax.swing.*;

import educrypt.gui.view.EducryptDialogView;
import educrypt.i18n.Messages;
import educrypt.resources.EduCryptResources;

class WaitDialog extends EducryptDialog implements EducryptDialogView {
	private static final long serialVersionUID = 7759747441262140363L;

	private final JPanel contentPanel = new JPanel();

	public WaitDialog(Window owner) {
		super(owner);

		setTitle(Messages.getString("guiPleaseWait"));

		setSize(400, 100);
		setPreferredSize(getSize());
		setResizable(false);

		getContentPane().setLayout(null);
		contentPanel.setBounds(0, 0, 0, 0);
		contentPanel.setLayout(new FlowLayout());
		getContentPane().add(contentPanel);

		ImageIcon throbber = new ImageIcon(
				EduCryptResources.getImageURL("throbber.gif"));
		JLabel lblThrobber = new JLabel(throbber);
		lblThrobber.setBounds(80, 20, 32, 32);
		getContentPane().add(lblThrobber);

		JLabel lblNewLabel = new JLabel(Messages.getString("guiPleaseWait"));
		lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblNewLabel.setBounds(136, 20, 182, 32);
		getContentPane().add(lblNewLabel);
	}

	@Override
	public void addListener(ActionListener ctr) {

	}
}
